Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I´ve this expression:
COUNT( {$<NR_FATO={3}, CD_MOTIVO={10,31}>} CHAVE)
The dimension is a DATE. My trouble is, when DATE IS WEEKEND, i have tu use CD_MOTIVO={31}.
When DATE is a normal day (MOnday, Tuesday.... friday) i have to use CD_MOTIVO={10}.
Thank you
Create a Field to denote a weekend flag and make expression as
Lets say If weekEnd then 1 else 0
COUNT( {$<NR_FATO={3}, CD_MOTIVO={10}, IsWeekEnd={0}>+<NR_FATO={3}, CD_MOTIVO={31}, IsWeekEnd={1}>} CHAVE)
Hope it helps
Celambarasan
Create a Field to denote a weekend flag and make expression as
Lets say If weekEnd then 1 else 0
COUNT( {$<NR_FATO={3}, CD_MOTIVO={10}, IsWeekEnd={0}>+<NR_FATO={3}, CD_MOTIVO={31}, IsWeekEnd={1}>} CHAVE)
Hope it helps
Celambarasan
HI
Try like this
=if(wildmatch(DATE,'Sunday','Ssaturday'),COUNT( {$<NR_FATO={3}, CD_MOTIVO={10}>} CHAVE),COUNT( {$<NR_FATO={3}, CD_MOTIVO={31}>} CHAVE))
or
if(Date = 'Sunday' or Date ='Saturday',COUNT( {$<NR_FATO={3}, CD_MOTIVO={10}>} CHAVE),COUNT( {$<NR_FATO={3}, CD_MOTIVO={31}>} CHAVE))
Hope it helps
Hi,
Try:
if(wildmatch(DATE,'sat*','sun*'),COUNT( {$<NR_FATO={3}, CD_MOTIVO={31}>} CHAVE),
COUNT( {$<NR_FATO={3}, CD_MOTIVO={10}>} CHAVE))
Regards
Hey Mayil,
i think in the meantime while i was writing the solution u had already posted
QV rocks !!!!
Regards
Hi João,
I have an idea for you, you could make a verification for weekends like this:
if(
WeekDay(DATE) = 5 or WeekDay(DATE) = 6,
COUNT( {$<NR_FATO={3}, CD_MOTIVO={31}>} CHAVE),
0
)
+
if(
WeekDay(DATE) <> 5 and WeekDay(DATE) <> 6,
COUNT( {$<NR_FATO={3}, CD_MOTIVO={10}>} CHAVE),
0
)
The values 5 and 6 are for Saturday and Sunday. I don't know if this is the best solution, probably not but may help you to workaround.
Regards,
Cesar Accardi
Set a variable weekEnd values 1 or 0
COUNT( {$<NR_FATO={3}, CD_MOTIVO={10}, IsWeekEnd={0}>+<NR_FATO={3}, CD_MOTIVO={31}, IsWeekEnd={1}>} CHAVE)