Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

IS EXPR CORRECT?

to find out the  today used space

=sum({<year={$(=year(today())}>}(usedspace/totalspace)*100)

to find out the  yesterday used space

=sum({<year={$(=year(today()-1)}>}(usedspace/totalspace)*100)

i am giving these 2 expressions in bar chart

please tell me these 2 are correct or not ? if not? correct me .

14 Replies
Not applicable
Author

Hi,

It won't give today's data.it will give this year data

year(today()) means assume today 14/10/2014 so it will give here year=2014 so it will calculate all the 2014 year data it won't calculate today's data

as it is second expression is also give 2013 year whole data it won't give yesterday's data.

expressions are correct as per your requirement it is not give proper result to you.

PrashantSangle

Hi,

Expression is correct but the purpose for which you are using is wrong

If you comparing Year field with today's Year and Yesterday's Year give you

Sum of same year i.e. 2014

Basically if want to comapare with today and Yestarday, You have to compare with complete dateField

i.e. Your expression like

for Today

=sum({<DateField={$(=Date(today())}>}(usedspace/totalspace))*100

or

It can be

sum({<DateField={$(=Date(today())}>} usedspace)/Sum({<year={$(=year(today())})>}Total Space)*100

  

For Yesterday

=sum({<DateField={$(=Date(today()-1)}>}(usedspace/totalspace))*100

Again check Date Format to get correct Output

Regards

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 🙂
Anonymous
Not applicable
Author

here i have no date field what todo ?

Not applicable
Author

sorry

you have to mention the today's date like 'datefield = today' and yeasterday's date like  'datefield = today-1'

mention datefield instead of year.

hope this help you.

Anonymous
Not applicable
Author

Hi malaya,

instead of datefield in above expression what i need to replace

Not applicable
Author

you have give the datefield in the expression

Anonymous
Not applicable
Author

i dont have  any date field in my data

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If you have no date field, how do you identify today's records and yesterday's records?

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

that is the main problem here .

but once server reloading every day it will create indidual  qvd for everday