Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
noman212
Creator III
Creator III

Expression

Hi Community,

Please help me out as i am stuck in a problem.

I am trying to implement a functionality in Self service BI, like i have an expression for sales Sum(Sales) ,

Based on the dimensions i have Date Month and Year's Dimension

I want if i select Sales from Metric and Month from Dimension then its Return only last date record like 16th Feb,2017 Sales.

And when i select Date Dimension its show me date wise sales like 1,2,3,....16th Sales.

Awaiting your reply .

Regards

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Have you used the max function any where?

Also you can try this.

Sum(Aggr(Sum(Sales),Date))

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
noman212
Creator III
Creator III
Author

Thanks for your reply.

I am using this expression

Variable : Maxdate=max(Date)

Expression =sum(if(Date=MaxDate,Sales)).

But it do not return me the breakup of dates when i select Date from Dimension.

vinieme12
Champion III
Champion III

Change your expression to identify what has been selected

     =if(Dimension=Date , Sum(Sales) , if(Dimension = Month , Sum(Date = {"$(vMaxDate)"} Sales) ))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

It is because the variable is set before chart starts calculating, it is not possible to have a different value of Max for each dimension.

What method are you using to change the dimension in chart?

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
noman212
Creator III
Creator III
Author

Please suggest any alternative as if i select Month its return max date else date wise breakup

sasikanth
Master
Master

Or you can Try this

If(GetselectedCount(Month)>0, Sum({<Date={ "$(=max(Date) )"}Sales), sum(Sales))