Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
alexander__
Contributor III
Contributor III

Count value of a day for every day of the month / Wert eines Tages für alle Tage des Monats zählen

Hello,

I have an Excel list in which I have a value for each month.

Format :      01.01.2016  17,4

                   01.02.2016  18,5

From another list I get values for each day of the month.

Format :      01.01.2016  17,8

                  02.01.2016  18,2               

                  03.01.2016  18,0

ect...

Now I would like to ask the two values in a diagram over.

So much so that the values which were entered only for the first of the month, then apply to all other days of the month.

How can you do that?

Title was edited by Community Moderator to include English translation

3 Replies
swuehl
MVP
MVP

There are different ways to approach this. You could for example create a calendar table and two fact tables for your different granularity:

Monthly:

LOAD * INLINE [

MonthStart, MonthlyValue

01.01.2016,  "17,4"

01.02.2016,  "18,5"

];

Daily:

LOAD * INLINE [

Date, DailyValue

01.01.2016,  "17,8"

02.01.2016,  "18,2"              

03.01.2016,  "18,0"

];

Calendar:

LOAD *, MonthStart(Date) as MonthStart;

LOAD Date(Makedate(2016)+recno()-1) as Date

AutoGenerate 60;

This already allows you to get your numbers correct when using Date as dimension and Sum(MonthlyValue) resp. Sum(DailyValue) for the measures.

See attached sample file.

A little more advanced approach would allow you to use a single fact table with mixed granularity:

Fact Table with Mixed Granularity

Hope this helps,

Stefan

marcus_sommer

Hello Alex,

I'm assuming that this is the data is actual data and PLAN data having a different granularity. I personally prefer this type of data, this via concatenate out in a table together, which is very simple and works well and potential problems (if for actual data there is no PLAN and vice versa) avoids in joining or associating the tables.

If IS and extrapolated from the HR and the PLAN are not compared to the daily level but at the month level, you need nothing else to do, as this table with a master calendar - How to use - Master Calendar and Date Values ​​- to connect and select the month in the chart as a dimension, rather than formulas come simply sum (IS) and sum (PLAN) to use.

Conversely, if a comparison on a daily level is required, the distribution of the monthly budget figures on the day with generating each calendar day is necessary. Here is an example of how it might look:

Load

     date (date + iterno () - 1, 'DD.MM.YYYY') as date,

     PLAN / (floor (mont starting (date)) - floor (month start (date)) + 1) as PLAN

From schedule table while iterno () <= (floor (mont starting (date)) - floor (month start (date)) + 1);

Otherwise also will be helpful: Get started with developing Qlik data models

Kind regards

Marcus

- - - -

Hallo Alex,

ich nehme mal an, dass es sich bei den Daten um IST-Daten und PLAN-Daten handelt, die eine unterschiedliche Granularität aufweisen. Ich persönlich bevorzuge bei dieser Art von Daten, diese in eine Tabelle per concatenate zusammen zuführen, was sehr einfach ist und gut funktioniert und potentielle Probleme (wenn für IST-Daten kein PLAN vorliegt und umgekehrt) bei joining oder associating der Tabellen vermeidet.

Sofern IST und daraus hochgerechnet die HR und der PLAN nicht auf der Tagesebene sondern auf der Monatsebene verglichen werden, braucht man nichts weiter zu tun, als diese Tabelle mit einem Master-Kalender - How to use - Master-Calendar and Date-Values - zu verbinden und den Monat im Diagramm als Dimension zu wählen und als Formeln kommen dann einfach sum(IST) und sum(PLAN) zum Einsatz.

Wenn hingegen ein Vergleich auf Tagesebene erforderlich ist, wird die Verteilung der Monatsplanzahlen auf den Tag mit Generierung jeden einzelnen Kalendertages notwendig. Hier mal ein Beispiel, wie es aussehen könnte:

Load

     date(Datum + iterno() - 1, 'DD.MM.YYYY') as Datum,

     PLAN / (floor(monthend(Datum)) - floor(monthstart(Datum)) + 1) as PLAN

From PlanTabelle while iterno() <= (floor(monthend(Datum)) - floor(monthstart(Datum)) + 1);


Ansonsten wird auch das noch hilfreich sein: Get started with developing qlik datamodels

Schöne Grüße

Marcus

Edited by Community Moderator to include English translation.

alexander__
Contributor III
Contributor III
Author

Hello Marcus,

very well recognized, there is a PLAN value what I have in the specification for each 01 of the month, but which is valid for the whole month.

and I have actual values for each day.

The analysis on a monthly basis would be no problem right.

But now the whole Prefer to day level.

Then I try me times to your proposal!

Thank you very much!

- - - -

Hallo Marcus,

sehr gut erkannt, es handelt sich um einen PLAN-Wert welchen ich in der Vorgabe jeweils für den 01. des Monats habe, welcher aber für den ganzen Monat gilt.

und ich habe IST-Werte für jeden einzelnen Tag.

Die Auswertung auf Monatsebene wäre kein Problem richtig.

Aber das ganze Möchte ich nun auf Tagesebene.

Dann probier ich mich mal an deinem Vorschlag!

Dankeschön!

Edited by Community Moderator to include English translation.