Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Days vs Depth- Script

Hello,

I am having trouble calculating/scripting the cumulative days at a specific depth in QlikView. I currently have an sql table which pulls in the date and the depth at that specific date.  But instead of the date as a dimension I want a count of days up to that specific point.

An aggr(count(Days), Dim) brings in a total count of days which does not work for my analysis.

Ex:

Current:

Depth

   1500

   1000

     500

           3/1/2016 | 3/2/2016 | 3/3/2016 | 3/4/2016 | 3/5/2016 |    days

Goal:

Depth

   1500

   1000

     500

        0 | 1 | 2 | 3 | 4 | 5 |    days

Can someone please advise?

Thanks,

Jared

2 Replies
MVP
MVP

Re: Days vs Depth- Script

Maybe a calculated dimension like

Aggr( days -Min(TOTAL days), days)


edit: Take care that your days date field shows a numeric representation, e.g. by using a default DateFormat in your script


SET DateFormat = 'M/D/YYYY';

Re: Days vs Depth- Script

I not sure I understand your setting. Would you be able to share a qvw sample?

Community Browser