Qlikview - show min and max date from date listbox - date

I have ListBox with value day(Date) and shows results:
1
2
3
4
5
6
7
I want when select number from 2 to 5 in table get result
Date from Date To
02-02-2022 05-02-2022
Can anyone help me please, how to show first and last selected value from list box?

You could do it in 2 text boxes of the form
='Date from'&chr(15)&
date(min(Date),'DD-MM-YYYY')
chr(15) is to create a new line. Just switch out the min() for max() as needed

Related

Fill a column with a date that satisfies an id statement in Sap Phoenix Webi

I am trying to fill in the date needed column with the date that has 1 in Match comment and Rank columns. More specifically from all the comments I only need the ones that satisfy a pattern and then I ranked those based on activity date. I need to keep the date that satisfies the last two requirements and fill the DateNeeded column with this date no matter the content of the row.
Ex. Table
Code / activity.date / rank / matchComFlag / DateNeeded
Jfkffj 03/8/22 2 1 10/8/22
Jdiffi 10/8/22 1 1 10/8/22
So i created a variable that has the activity date formated where both flags are one but this only fills the row that applys and the others are blank.
How can i fill the whole DateNeeded column with the date I need?
Thank you in advance!

I am trying to combine 6 columns into two, I cant use concatenate, Google Sheets is constantly updating the rows

So I am trying to combine 6 columns
Number
Date
Number
Date
Number
Date
1
1/12/21
2
2/20/21
3
3/5/21
2
2/12/21
3
2/27/21
4
4/1/21
3
1/15/20
4
1/20/21
1
3/30/21
4
1/4/21
1
2/25/21
2
4/2/21
So what I am trying to accomplish is that these rows would combine into two with the latest date being displayed:
Number
Date
1
3/30/21
2
4/2/21
3
3/5/21
4
4/1/21
To get the latest date, I have tried to use
=query('scba fill practise'!A:G,"select A, max(G) group by A")
To get all my numbers to constantly update, I've used
=UNIQUE({A3:A;C3:C;E3:E})
Maybe something like this?
=QUERY({'scba fill practise'!A2:B4;'scba fill practise'!C2:D4;'scba fill practise'!E2:F4}, "SELECT Col1, MAX(Col2) GROUP BY Col1")

Last 12 month avg in tableau label ( not using any table detail only with label)

Need your help in creating last 12 month avg in tableau put it in a single label
here I tried using window_avg i am able to get the 12 months avg but if i use it label / showing single value for the last month .. it is not working
WINDOW_AVG(SUM([Balance Total]),-11,0)
I am not able to add the sample file so added image .. the expected output is 392306.6 ... or any logic with sample data would be more helpful
Keep your working window avg calc. Create an LAST calculated field.
LAST()
Place it in the filter shelf and set values to zero.
This will hide all other dates in the view but keep the correct window calculation. LAST does not need to be in the view. I only showed it for demo purposes on the screenshot above.

How to get the COUNT of rows in Crystal Report

I have a data in database which gives me 8 rows based on date range out of which 5 are HCT, is there any formula in crystal report where I can get that count of those 'Abbr' ?
I am comparing HCT text from Dynamic report selection, I need to know can we create a variable which gives us count of 'Abbr'.
like for
HCT should return 5
US should return 2
RN should return 1 value.
UPDATE 1:
Here is what I am trying to do. I have secondary selection criteria as Dynamic report along with date range.
in the above example I have selected only "HCT", now even though sql data is returning 8 rows (HCT,US,RN) I need only the HCT count i.e. 5.
If I select "HCT" and "US" in the secondary criteria then I should get count of both HCT and US i.e. 5 + 2 = 7.
if I am not selecting anything then it should return 0, so irrespective of the data from DB, the value should be summed based on selection of my criteria.
am I clear enough?
Use Running Totals.
Specifically, make a Distinct Count running total for each Date Range code. You can set a formula in the Running Total Wizard to only evaluate records where, for example, {DateRange} = "HCT"
I found the solution for my question, I am just putting it here so that someone may help for the above mentioned formula.
This is what I did
Created a Formula(not running totals) by name SumOfSkills
if({Command.GlobalSkillAbbr} in {?GlobalSkill}) then 1 else 0
here Command.GlobalSkillAbbr is my "HCT" and '{?GlobalSkill} will contain all Global skills.
and used another formuala to sum it up.
Sum(SumOfSkills)
which gives me desired output.

crosstab report how to calculate specific columns values and subtract from row total

am stuck at a point that in Crosstab report, i need to have sum of only two column's value and subtract the total by the value what should i do?
as in below,
Product 1 Product2 Product 3 Total
----------------------------------
Cust 1 4 5 2 11
Cust 2 5 9 7 19
I want to sum values of "Product 1","Product 3". then subtract from row total=> Total
LIKE
[4+2]-11=>TOtal.
and want to repeate this for each customer..
anyone please help me out.
I'm not sure when embedded summaries were introduced but I am pretty sure that your version of Crystal has this functionality. If not I apologize ahead of time. I have only been using this method for a few months now and it is quite confusing at first. At least to me but it has come in quite handy.....
I am making the following assumptions about your crosstab. Make name changes as you need to
row {yourtable.CustID}
Column {yourtable.product}
summarized field {yourtable.cost}
In the top left of your crosstab, right click go to advanced calculation and select calculated member
Select New and enter a description
For Type: Select Column
For insert Evaluation: Select After
Click edit insertion value and enter
CurrentColumnIndex=(GetNumColumns-2)//This will insert a column just before the total column
Click edit header formula and enter in quotes what you want to call the column
Select the content in Value Formulas then click Edit Value formula and number value
Save and close then exit the calculated member expert
Your crosstab should now have a new column
Right click the value go to Calculated member and select edit calculation formula
Enter this formula
(
GridValueAt (CurrentRowIndex,0 , 0) // Product 1 value
+
GridValueAt (CurrentRowIndex,2 , 0) // Product 2 value
)
-
GetTotalValueFor "yourtable.product")
NOTE: Geez it is hard to post on this site!
well after thinks long on it I've have done......
1st be clear that crystal report 10 is not offer following function
"CurrentRowIndex", "GridValueAt"
 
that's why above solution by "CoSpringsGuy" is not applicable.......
as we have two tables. 1 customer and 2nd for products and by both we generate crosstab with summarize field of product_sold (Qty) and 2 crosstab columns “Product.name”  and sub column product. Type
Now we want to sum value under the product.packing type =”Pilot”  of  product sold to each customer and subtract the sum-up from grand total of all products (product type “Normal” and “Pilot”)
For this problem 1st we have to work on formatting formula at crystal runtime and manipulate to “Display string” of summarize field
And then we will edit totals i.e very last column
1st edit summarize filed “display string” with the help of following code
Global CCust As String to keeping last customer for teli new customer name
Global Ccol As String ' tht is for keeping last column/product.packing type and teli with new col
Global Rndx as number ' this is for generating index of the row
Global totperx(22) as number ' is to hold the currnt value of cell and adding with previous value
' and i imagen that number of customers will less then 22 otherwise you can take unlimited array
Whileprintingrecords
if (CCust="") then
CCust=gridrowcolumnvalue("Table_Cust.Name")
Ccol=gridrowcolumnvalue("Viw_Prod.Packing")
Rndx=1
formula="new"
end if
if CCust<>gridrowcolumnvalue("Viw_Prod.Packing") then
formula="same"
Rndx=Rndx+1
else
formula="Newag"
end if
if Ccol<>gridrowcolumnvalue("Viw_Prod.Packing") then
Rndx=1
end if
if gridrowcolumnvalue("Viw_Prod.Packing")="Pilot" then
totperx(Rndx)=totperx(Rndx)+currentfieldvalue
end if
formula=totext(currentfieldvalue,0,"") ' despite of cstr function totext will change 45 to 45 while cstr changes 45 to 45.00
CCust=gridrowcolumnvalue("Table_Cust.Name")
Ccol=gridrowcolumnvalue("Viw_Prod.Packing")
now we will edit "Display String" of grand total column
Global my as number
Global totperx(22) as number
whileprintingrecords
if my<1 then
my=1
end if
formula=currentfieldvalue-totperx(my)
my=my+1