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

Announcements
Congratulations to the new Qlik Luminary and Partner Ambassador class! Meet them here
cancel
Showing results for 
Search instead for 
Did you mean: 
aisolomatin
Contributor III
Contributor III

Ad-hoc reporting, set analysis

Hi, there!

Need your help with issue: I need to make expression, that will calc a Sum(Value) for max DateReport.

But if DateReport has added to table as Dimension, then I need to get Sum(Value) for current DateReport.

Here example. I try to use expression

=If(Dimensionality()=0,

  Sum({<DateReport={"$(=Max(Date(DateReport)))"}>}Value),

  Sum(Value)).

But problem is that it works fine for first table, but doesn't work for second.

Ex_2.png

Second table should look like this:


Ex_2_2.png


I need to use it in Ad-hoc reporting, so I have one table with all Dimensions (users choose Dimensions for table by themselves), and I need one expression.

Labels (1)
33 Replies
Anil_Babu_Samineni
MVP
MVP

Does this you are expecting simple two expressions for 2 different charts? Or You want to make as Ad-Hoc reports the same?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
aisolomatin
Contributor III
Contributor III
Author

No.

Your exp for 1st table:

= IF(Dimensionality() = 3, Sum(Value), Sum({< NewDate = {'$(vMaxDate)'}  >} Value))

for second:

= Sum( {< NewDate = {'$(vMaxDate)'}, Branch= >} Value)

As you see, they have different syntax.

I need the same expressions (with same syntax) which fits for both tables.

aisolomatin
Contributor III
Contributor III
Author

I need 1 expression for two charts.

It should fit for both charts.

Anil_Babu_Samineni
MVP
MVP

May be i miss something the requirement, Seems what you need i've shown the same, Assuming. If not Can you tell me why you want only single syntax for 2 different Objects?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
aisolomatin
Contributor III
Contributor III
Author

Because in output solution will be only 1 table, and user will be decide which Dimensions he want to add to table.

Anil_Babu_Samineni
MVP
MVP

Tell me how you are expecting in Table, Even thought it is single tabular you must show the expected object? So that we may get better thoughts. And i would highly recommend to mark as helpful if you found some thing related while Thread

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vishsaggi
Champion III
Champion III

No did you check my latest file? I am using the same expression in those two tables.

Which is this.

= IF(Dimensionality() = 3, Sum(Value), Sum({< NewDate = {'$(vMaxDate)'}  >} Value))


Capture.PNG

Unless if i am missing something completely different to what you are expecting?

aisolomatin
Contributor III
Contributor III
Author

Check this out:

http://eu-a.demo.qlik.com/QvAJAXZfc/opendoc.htm?document=qvdocs%2FUniversity%20Admissions.qvw&host=d...

Sheet: Applicant Details.

My solution works like this.

aisolomatin
Contributor III
Contributor III
Author

So your Expression is the:

= IF(Dimensionality() = 3, Sum(Value), Sum({< NewDate = {'$(vMaxDate)'}  >} Value))


The weak of this solution is if we remove, for example, Dimension [Subbranch] from the 1st table, the result will be like that:


Ex_2_7.png

So, it's not fit.

vishsaggi
Champion III
Champion III

Try this?

= IF(Dimensionality() > 0, Sum(Value), Sum({< NewDate = {'$(vMaxDate)'}  >} Value))