Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculation based on user selection

Hi all,

I've got 3 time variables on my dashboard, year, month and quarter. behind the scenes I have 3 inflation tables, one for year, one for quarter and one for month. I have a calculation in a waterfall where the value you see depends on what time period the user has selected.

So when the user selects 2014 only the figure used for the calculation comes from the year table only.

If they select a particular year and then a quarter, e.g 2014 Q1 then the calculation comes from the quarter table.

If they select 2014 and Jan, then the figure used for the calculation comes from the month table.

I was trying to use something like if(Getcurrentfield)=year, perform calculation using value(s) from the year table,

if(Getcurrentfield)=quarter, perform calculation using value(s) from qtr table,

if(Getcurrentfield)=month, perform calculation using value(s) from year table.

Thanks

Adrian

2 Replies
Anonymous
Not applicable
Author

Hi Adrian,

I would recommend placing this question in the "New to QlikView" message board.  Qlik Sense is a brand new product, and it requires a new way of thinking for this business requirement since UI variables do not exist.

Try using logic in a calculate dimension that changes based on the DISTINCT COUNT of the different time fields.  This approach works for both products.

Example:

=IF(COUNT(DISTINCT Month)=1, Year,

IF(COUNT(DISTINCT Quarter)=1, Quarter,

MonthYear))

Cheers,

Sean

Michael_Tarallo
Employee
Employee

Hi Adrian, I moved this over as per Sean's suggestion.

Mike

Qlik

Regards,
Mike Tarallo
Qlik