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: 
Sebastian_Dec
Creator II
Creator II

Why Max(Data)-X not working

Hi, I wonder, why my expression not working.
Its good only with no selections:

Sebastian_Dec_0-1715760076511.png

 

When I chose date its 0, I would like it to show the sum result for the current date minus 2 days

Sebastian_Dec_1-1715760169292.png

My expresion:

Sum({<Data={"$(= date((Max(Data)-2)))"}>} stan_wartosc)

 

My code in Data Load Editor look like this:

NoConcatenate
Stan_Wartosc_2:
Load
    date(floor(Data)) as Data,
	hid_dossier_ges, 
	hid_artykul_ges,
    sum(stan_wartosc) as stan_wartosc
Resident Stan_Wartosc
Group By
	Data,
	hid_dossier_ges, 
	hid_artykul_ges
    ;
    
Drop Table Stan_Wartosc;

 

 

 

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

It is your selection in your calculated dimension "=(Data)" that is causing you your problem. This dimension is not the same as "Data". So you are performing a set modifier on the field Data while having a selection on "=(Data)". 

 

Try changing your dimension from being a calculated one using "=(Data)" to just use the field "Data".

Vegar_1-1715764825313.png

 

 

View solution in original post

7 Replies
Vegar
MVP
MVP

It is your selection in your calculated dimension "=(Data)" that is causing you your problem. This dimension is not the same as "Data". So you are performing a set modifier on the field Data while having a selection on "=(Data)". 

 

Try changing your dimension from being a calculated one using "=(Data)" to just use the field "Data".

Vegar_1-1715764825313.png

 

 

PrashantSangle

check in your expression editor what values it is evaluating 

PrashantSangle_0-1715764944757.png

 

Send screenshot of it. Also check date format in script.

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Vegar
MVP
MVP

I where able to recreate your issue on my own desktop client. See screenshots

Vegar_2-1715765263126.png

 

Sebastian_Dec
Creator II
Creator II
Author

@Vegar Thank you very much, "stupid" typo, and I spent 4 hours on it today.
Yes there is a difference between Data and (Data) - now I will know 🙂

Btw, I tested it on Excel files, new applications, old ones and I was already tearing my hair out "because I've done it X times and it always worked..."

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hey @Sebastian_Dec hope you are well man!

I will just add this that you may want to change your master dimension and remove from it "=" sign s there is not point creating it as =(Data)

you could have just straight up field reference!

 

EDIT - @Vegar already mentioned that below which i missed. sorry!

cheers Lech, 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 to the problem.
Sebastian_Dec
Creator II
Creator II
Author

Hi @Lech_Miszkiewicz , thanks for replay, all is good 🙂

I quickly changed the copied sheet with filters =Month(Data) and instead of leaving just 'Data', I only removed 'Month', so it ended up as =(Data). This is actually the first time something like this happened to me 😛

 

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Sebastian_Dec 

As a good practice you also dont want to have =Month(Data) and instead it is so much better to just do that in script Month(Data) as Miesiąc, - you know what I mean.

cheers

cheers Lech, 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 to the problem.